<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Order list_{$webname}</title>
<meta name='keywords'    content='{$keywords}'>
<meta name='description' content='{$description}'>
<!--公共样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/reset.css" />
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/common.css" />
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/FontAwesome/css/font-awesome.min.css" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/FontAwesome/css/font-awesome-ie7.min.css" />
<![endif]-->
<!--公共样式结束-->
<!--页面样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/page_m_order.css" />
<!--页面样式结束-->
<script type="text/javascript" src="{$NOW_THEME_URL}/Assets/Js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="{$NOW_THEME_URL}/Assets/Js/jquery.SuperSlide.2.1.1.js"></script>
</head>

<body>
	<div class="zhezhao"></div>
<div class="zz">
	<!--top start-->
	<include file="Public:header" lang="true" />
	<!--top end-->
	<!--content start-->
	<div class="content clearfix">
		<div class="member_left">
			<ul>
				<li><a href="{:U('Member/index')}" class="color_main"><i class=" icon-user"></i>Information</a></li>
				<li><a href="{:U('Member/order_index')}" class="hover color_main"><i class=" icon-file"></i>Order</a></li>
				<li><a href="{:U('Member/address_index')}" class="color_main"><i class=" icon-list"></i>Address</a></li>
				<li><a href="{:U('Member/index')}" class="color_main"><i class=" icon-unlock"></i>Password</a></li>
			</ul>
		</div>
		<!--member_right start-->
		<div class="member_right">
			<div class="mr_title color_main">My Order</div>
			<form action="{:U('/Public/login')}" method="post" id="formTable" name="formTable" class="formTable">
				<table class="lotab">
					<tr>
						<th width="170px">Order Number</th>
						<th>Mobile</th>
						<th>Order Status</th>
						<th>Order totalprice</th>
						<th>Time</th>
						<th>Operate</th>
					</tr>
					<eq name="orderlist[0]['orderno']" value="">
						<tr>
							<td colspan="6">There is no order</td>
						</tr>
					<else />
						<foreach name="orderlist" item="vo">
							<tr>
								<td>{$vo.orderno}</td>
								<td>{$vo.mobile}</td>
								<td>
									<volist name='enstatus' id='v'>
										<eq name="vo.status" value="$key">{$v}</eq>
									</volist>
								</td>
								<td>{$vo.orderfee}</td>
								<td>{$vo.addtime|date='Y-m-d H:i',###}</td>
								<!-- <td><a href="{:U('Member/order_detail','orderno='.$vo['orderno'])}" >detail</a></td> -->
								<td>
									<a href="{:U('Order/printpage','id='.$vo['id'])}" target="_blank">detail</a>&nbsp;
									<!--|&nbsp;<a data-id="{$vo.id}" class="addorder" style="cursor:pointer">Order again</a>-->
								</td>
							</tr>
						</foreach>
					</eq>
				</table>
			</form>
		</div>
		<!--member_right end-->
	</div>
	<!--content end-->
	
	<!--footer start-->
	<include file="Public:footer" lang="true" />
	<!--footer end-->
	<!--online start-->
		
	<!--online end-->
</div>
<script type="text/javascript">
	//返回顶部
	$(window).on('scroll',function(){
		var scrollTop = $(document).scrollTop();
	});
	
	$(function(){
		//悬浮框显示隐藏
		$('.online').on('hover',function(){
			$('.online ul').toggle();
			//$('.rlico').toggleClass('rlico2');
		});
		
		
	
		$('.addressinput').change(function(){
			var val = $(this).val();
			$('.addressspan').html(val)
			if(val){
				$('.address_choose').show();
			}else{
				$('.address_choose').hide();
			}
		})
		
		$("#href_1").on('click',function(){
			var href = addic();
			$(this).attr(href);
			$(this).attr({ href: encodeURI(href) });
		});
		
		//再次下单
		$('.addorder').on('click',function(){
			var id = $(this).attr('data-id');
			if(confirm('Confirm to submit a same order?')){
				$.get("{:U('Member/addOrder')}",{id:id},function(data){
					if(data.status==1){
						alert('Order success!');window.location.reload();
					}else{
						alert(data.info);
					}
				});
			}
		});
		
		var value= location.href.split("=")[1];
		$('.color_main em').html(value);
	});
	
	function addic(){
		var addval = $('.addressinput').val();
		return "restaurant.html?aid="+addval;
	}

</script>
</body>
</html>
